package com.vvlive.caibao.smartcity.utils;

import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.AnticipateInterpolator;
import android.view.animation.AnticipateOvershootInterpolator;
import android.view.animation.BounceInterpolator;
import android.view.animation.CycleInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.LinearInterpolator;
import android.view.animation.OvershootInterpolator;

/**
 * Created by zhj on 2015/7/4.
 */
public class InterpolatorUtil {

    /**
     * 在动画开始与结束的地方速率改变比较慢，在中间的时候加速
     * @return
     */
    public static AccelerateDecelerateInterpolator getAccelerateDecelerateInterpolator(){
        return new AccelerateDecelerateInterpolator();
    }

    /**
     * 在动画开始的地方速率改变比较慢，然后开始加速
     * @return
     */
    public static AccelerateInterpolator getAccelerateInterpolator(){
        return new AccelerateInterpolator();
    }

    /**
     * 开始的时候向后然后向前甩
     * @return
     */
    public static AnticipateInterpolator getAnticipateInterpolator(){
        return new AnticipateInterpolator();
    }

    /**
     * 开始的时候向后然后向前甩一定值后返回最后的值
     * @return
     */
    public static AnticipateOvershootInterpolator getAnticipateOvershootInterpolator(){
        return new AnticipateOvershootInterpolator();
    }

    /**
     * 动画结束的时候弹起
     * @return
     */
    public static BounceInterpolator getBounceInterpolator(){
        return new BounceInterpolator();
    }

    /**
     * 动画循环播放特定的次数，速率改变沿着正弦曲线
     * @param cycles
     * @return
     */
    public static CycleInterpolator getCycleInterpolator(float cycles){
        return new CycleInterpolator(cycles);
    }

    /**
     * 在动画开始的地方快然后慢
     * @return
     */
    public static DecelerateInterpolator getDecelerateInterpolator(){
        return new DecelerateInterpolator();
    }

    /**
     * 以常量速率改变
     * @return
     */
    public static LinearInterpolator getLinearInterpolator(){
        return new LinearInterpolator();
    }

    /**
     * 向前甩一定值后再回到原来位置
     * @return
     */
    public static OvershootInterpolator getOvershootInterpolator(){
        return new OvershootInterpolator();
    }


}
